﻿using UnityEngine;
using UnityEngine.UI;
using System.Runtime.InteropServices;

public class FocusPopup : MonoBehaviour
{
    public Button focusButton;

    void Start()
    {
        focusButton.onClick.AddListener(SetFocusToPopup);
    }

    void SetFocusToPopup()
    {
        // Unity调JavaScript
#if UNITY_WEBGL && !UNITY_EDITOR
        SetFocusToPopupJS();
#endif
    }

    [DllImport("__Internal")]
    private static extern void SetFocusToPopupJS();
}